-
Notifications
You must be signed in to change notification settings - Fork 18
fix: v3 error response handling #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
==========================================
+ Coverage 70.37% 70.75% +0.38%
==========================================
Files 35 35
Lines 2356 2380 +24
==========================================
+ Hits 1658 1684 +26
+ Misses 698 696 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances error handling for InfluxDB v3 write operations by parsing and formatting structured JSON error responses that contain detailed line-by-line error information. The implementation aligns with similar functionality in other InfluxDB client libraries like influxdb3-go.
Changes:
- Added parsing logic for v3 write error responses with detailed error information per line
- Added
status_codeattribute toApiExceptionfor compatibility - Comprehensive test coverage for various error response formats
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| influxdb_client_3/exceptions/exceptions.py | Implements parsing of v3 error format with error and data fields, formatting detailed line-specific errors |
| influxdb_client_3/write_client/rest.py | Adds status_code attribute alias to ApiException for API compatibility |
| tests/test_api_client.py | Adds comprehensive unit tests covering multiple edge cases for v3 error parsing |
| tests/test_influxdb_client_3_integration.py | Adds integration test verifying v3 error handling with real server responses |
| CHANGELOG.md | Documents the bug fix for v3 write error details handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bednar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Closes #
Proposed Changes
v3 endpoint error can be a structured JSON. eg. write error:
{ "error": "partial write of line protocol occurred", "data": [ { "error_message": "invalid column type for column 'v', expected iox::column_type::field::integer, got iox::column_type::field::float", "line_number": 2, "original_line": "testa6a3ad v=1 17702" } ] }This PR fixes handling of such payload and resulting error message is constructed with all the error detail (and is aligned with other client libs like influxdb3-go):
Checklist